#!/bin/bash

source parameters.sh

run_corr_nstep=`echo "($run_corr_dt+$run_dt*0.5) / $run_dt" | bc`

cd gpu-md

cd app
cp lj.nhc.cu lj.nhc.cu.bk
cd ..
sed -e "s/ScalorType dt = .*/ScalorType dt = $run_dt;/g" app/lj.nhc.cu |\
sed -e "s/IndexType confFeq = .*/IndexType confFeq = $run_corr_nstep;/g" > tmp.tmp.tmp
mv -f tmp.tmp.tmp app/lj.nhc.cu
make -j 8

command="./lj.nhc ../$run_init_conf $run_nstep $run_device_num"
echo "# command is: $command" &> run.log
$command &>> run.log

cd ..
